package com.springboot.test.controller;

import com.springboot.test.properties.Car;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author likai
 * @date 2021/10/8 5:02 PM
 * @email likai9376@163.com
 * @desc
 */
@RestController
public class DemoController {

    @Autowired
    private Car car;


    @RequestMapping(value = "/cat")
    public Object cat(){
        String name = car.getName();
        System.out.println("hello:"+name);
        return car;
    }


    @RequestMapping(value = "/hello",method = RequestMethod.GET)
    public Object hello(){
        int num = 10/0;
        return "null";
    }
}
